<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%
	HttpSession sess = request.getSession();
	
	//If tryied to access without autorisation
	if (sess.isNew()) {
		response.sendRedirect("/my-pet-project-0/Login.jsp");
	} else {
%>

<%
	//If really administrator
	if (((String) sess.getAttribute("UserRole")).equals("2")) {
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Manager Start Page</title>
</head>
<body>
	<center>
		<h1>
			Good day,
			<%=(String) sess.getAttribute("UserName")%></h1>
	</center>
	<br> This is your administrator start page.
	<br> You can start work here:
	<br>
	<a href="/my-pet-project-0/MAddItem.jsp">Add a new item</a>
	<a href="/my-pet-project-0/MDeleteItem.jsp">Delete an item</a>
	<a href="/my-pet-project-0/MApproveTransaction.jsp">Approve transaction</a>
	<br> ... or you can simply
	<a href="/my-pet-project-0/Login.jsp">logout</a>
</body>
</html>
<%
	} else {
%>
<%
	response.sendError(response.SC_FORBIDDEN,
					"Not permitted to enter as ADMINISTRATOR");
%>
<%
	}
	}
%>